<h1><code ng:non-bindable="">$exceptionHandlerProvider</code>
<span class="hint">(service in module <code ng:non-bindable="">ngMock</code>
)</span>
</h1>
<div><a href="http://github.com/angular/angular.js/edit/master/src/ngMock/angular-mocks.js"
        class="improve-docs btn btn-primary">Improve this doc</a>

    <h2 id="Description">Description</h2>

    <div class="description">
        <div class="ngmock-exceptionhandlerprovider-page"><p>Configures the mock implementation of <a
                href="api/ng.$exceptionHandler"><code>ng.$exceptionHandler</code></a> to rethrow or to log errors passed
            into the <code>$exceptionHandler</code>.</p></div>
    </div>
    <div class="member method"><h2 id="Methods">Methods</h2>
        <ul class="methods">
            <li><h3 id="mode">mode(mode)</h3>

                <div class="mode">
                    <div class="ngmock-exceptionhandlerprovider-mode-page"><p>Sets the logging mode.</p></div>
                    <h4 id="Parameters">Parameters</h4>
                    <ul class="parameters">
                        <li><code ng:non-bindable="">mode – {string} – </code>

                            <div class="ngmock-exceptionhandlerprovider-mode-page"><p>Mode of operation, defaults to
                                <code>rethrow</code>.</p>

                                <ul>
                                    <li><code>rethrow</code>: If any errors are passed into the handler in tests, it
                                        typically
                                        means that there is a bug in the application or test, so this mock will
                                        make these tests fail.
                                    </li>
                                    <li><code>log</code>: Sometimes it is desirable to test that an error is thrown, for
                                        this case the <code>log</code> mode stores an
                                        array of errors in <code>$exceptionHandler.errors</code>, to allow later
                                        assertion of them.
                                        See <a href="api/ngMock.$log#assertEmpty">assertEmpty()</a> and
                                        <a href="api/ngMock.$log#reset">reset()</a></li>
                                </ul>
                            </div>
                        </li>
                    </ul>
                </div>
            </li>
        </ul>
    </div>
</div>
